Skip to content

Conversation

mpociot
Copy link
Contributor

@mpociot mpociot commented May 13, 2025

This PR is the JS counterpart of inertiajs/inertia-laravel#732

For whatever reason, the tests did time out when I tried to run them via npx for my newly created API route. I did test it manually by running the server though.
Not really sure what I did wrong.

@HichemTab-tech
Copy link
Contributor

HichemTab-tech commented May 13, 2025

For whatever reason, the tests did time out when I tried to run them via npx for my newly created API route. I did test it manually by running the server though.
Not really sure what I did wrong.

Happened to me too in a previous PR, i just kept running the tests until it worked, i think we should increase the timeout a bit.

@pascalbaljet
Copy link
Member

Thanks @mpociot, this looks great! I'll add another test for props with multiple strategies. I expect you added support for this if you have resources like this:

$data = [
    'users' => [
        ['id' => 1, 'name' => '...'],
        ['id' => 2, 'name' => '...'],
    ],
    'companies' => [
        ['id' => 1, 'name' => '...'],
        ['id' => 2, 'name' => '...'],
    ],
];

Inertia::render('Dashboard', [
    'results' => Inertia::deepMerge($data, ['users.id', 'companies.id']),
]);

@pascalbaljet pascalbaljet merged commit 31c01ef into inertiajs:master Jun 13, 2025
6 checks passed
@pascalbaljet
Copy link
Member

Updated the test in bdc5ef6 to test multiple arrays with different keys and unique keys. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants